package com.burstly.lib.ui;

import android.content.Context;
import android.os.Handler;
import android.os.Looper;
import android.os.SystemClock;
import android.util.AttributeSet;
import android.util.Log;
import android.view.KeyEvent;
import android.view.MotionEvent;
import android.widget.LinearLayout;
import com.burstly.lib.BurstlySdk;
import com.burstly.lib.component.ComponentQueue;
import com.burstly.lib.component.ComponentQueue.IQueueComponentListener;
import com.burstly.lib.component.ComponentQueueElement;
import com.burstly.lib.component.FailedToShow;
import com.burstly.lib.component.IAdaptorController;
import com.burstly.lib.component.IBurstlyAdaptor;
import com.burstly.lib.component.IBurstlyAdaptor.TransactionCode;
import com.burstly.lib.component.IBurstlyAdaptorListener.FullscreenInfo;
import com.burstly.lib.component.IInternalBurstlyAdListener;
import com.burstly.lib.component.preinitialize.PreinitializeManager;
import com.burstly.lib.constants.UriConstants;
import com.burstly.lib.conveniencelayer.BurstlyAdSize;
import com.burstly.lib.exception.InvalidBurstlyViewStateException;
import com.burstly.lib.exception.UiExceptionHandlerManager;
import com.burstly.lib.exception.UnhandledExceptionDumpWrapper;
import com.burstly.lib.exception.WrongThreadException;
import com.burstly.lib.feature.FeatureFactory;
import com.burstly.lib.feature.currency.ICurrencyManager;
import com.burstly.lib.network.beans.RequestData;
import com.burstly.lib.network.beans.RequestData.Request;
import com.burstly.lib.network.beans.ResponseBean;
import com.burstly.lib.network.request.AbortableAsyncTask;
import com.burstly.lib.network.request.IAbortableRequest;
import com.burstly.lib.network.request.RequestManager;
import com.burstly.lib.network.request.RequestManager.ConnectionInfo;
import com.burstly.lib.network.request.RequestManager.RequestDataObject;
import com.burstly.lib.persistance.ResponseSaver;
import com.burstly.lib.service.ServerConfigurationService;
import com.burstly.lib.service.ServerConfigurationService.IServerConfigurable;
import com.burstly.lib.util.LoggerExt;
import com.burstly.lib.util.Utils;
import java.util.Collection;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;

public class BurstlyView extends LinearLayout
  implements ServerConfigurationService.IServerConfigurable, IErrorAndStateListener
{
  private static final String LOG_LEVEL = "logLevel";
  private static final String REQUEST_THROTTLE_KEY = "throttlingInterval";
  private static final String TAG = BurstlyView.class.getSimpleName();
  static LoggerExt sLog;
  private static int sRequestThrottle = 10000;
  IAdaptorController mActiveController;
  AttributeSet mAttributes;
  String mBurstlyViewId;
  IBurstlyAdListener mClientListener;
  private Map<String, String> mClientTargetParams;
  ComponentQueue mCurrentQueue;
  private IAbortableRequest mCurrentRequest;
  private Map<String, ?> mCustomCRIDParams = new HashMap();
  private final Map<String, Map<String, ?>> mCustomNetworkParams = new HashMap();
  private IAdaptorController mDisplayedBannerController;
  private IAdaptorController mDisplayedInterstitialController;
  ErrorAndState mErrorAndState;
  Set<FailedToShow> mFailedToShowComponents;
  IBurstlyAdaptorListener.FullscreenInfo mFullscreenInfo;
  final IInternalBurstlyAdListener mInnerWrapper = new BursltyListenerWrapper(null);
  private boolean mIsDestroyed;
  boolean mIsHidden = true;
  private Boolean mIsInterstitial;
  volatile boolean mIsPaused;
  long mLastSentTime;
  Runnable mLoadTimeLimit;
  Handler mMainHandler = new Handler(Looper.getMainLooper());
  private boolean mPrecacheRequest;
  boolean mPrecacheRequestSuccessfullyFinished;
  int mRefreshInterval;
  private final Autorefresh mRefresher = new Autorefresh(this);
  private RequestData mRequestData;
  private RequestManager mRequestManager;
  final BurstlyView mSelf = this;
  private int mServerSideRefreshInterval;

  public BurstlyView(Context paramContext)
  {
    this(paramContext, null);
  }

  public BurstlyView(Context paramContext, AttributeSet paramAttributeSet)
  {
    super(paramContext, paramAttributeSet);
    this.mAttributes = paramAttributeSet;
    BurstlySdk.init(paramContext);
    setClipChildren(false);
    setClipToPadding(false);
    setFocusable(true);
    setFocusableInTouchMode(true);
    setClickable(true);
    setGravity(17);
    this.mFailedToShowComponents = new HashSet(10);
    this.mRequestData = new RequestData();
    configureRequestData(paramContext);
    initializeView();
  }

  private void checkParamsValidity()
  {
    if ((this.mRequestData.getZone() == null) || (this.mRequestData.getZone().length() == 0))
      throw new InvalidBurstlyViewStateException(this, "Zone not set. Set zone before.");
    if ((this.mRequestData.getPublisher() == null) || (this.mRequestData.getPublisher().length() == 0))
      throw new InvalidBurstlyViewStateException(this, "Publisher not set. Set publisher before.");
  }

  private void configureRequestData(Context paramContext)
  {
    RequestData.Request localRequest = this.mRequestData.getData();
    localRequest.setUserAgentInfo(Utils.getUserAgent(paramContext));
    localRequest.setBundleId(paramContext.getPackageName());
    localRequest.setDeviceId(Utils.getDeviceId(paramContext));
    localRequest.setEncDevId(Utils.encryptedDeviceId(paramContext));
    localRequest.setAndroidId(Utils.encryptedAndroidId(paramContext));
    localRequest.setAcceptLanguage(Utils.getDeviceCurrentLanguage());
    localRequest.setEncMAC(Utils.encryptedMac());
    localRequest.setMac(Utils.getMacSha1());
  }

  private ComponentQueue.IQueueComponentListener createQueueListener()
  {
    return new BurstlyViewQueueListener(this);
  }

  private static void destroyController(IAdaptorController paramIAdaptorController)
  {
    if (paramIAdaptorController != null)
      paramIAdaptorController.destroy();
  }

  private Map<String, ?> getCridParams()
  {
    return this.mCustomCRIDParams;
  }

  private void initializeView()
  {
    if (getId() == -1)
      setId(super.hashCode() + hashCode());
    if (sLog == null)
      sLog = LoggerExt.getInstance();
    RequestManager.addToNetworkStateWatcher(this);
    Context localContext = getContext();
    this.mErrorAndState = new ErrorAndState();
    this.mErrorAndState.setBurstlyViewState(BurstlyViewState.IDLE);
    this.mRequestManager = new RequestManager(localContext, TAG);
    if (this.mAttributes != null)
      new BurstlyViewConfigurator(this).configure(this.mAttributes);
  }

  private boolean isTooEarly()
  {
    long l = SystemClock.elapsedRealtime() - this.mLastSentTime;
    int i = (int)(sRequestThrottle - l);
    if (l < sRequestThrottle)
    {
      LoggerExt localLoggerExt2 = sLog;
      String str2 = this.mBurstlyViewId;
      Object[] arrayOfObject2 = new Object[1];
      arrayOfObject2[0] = Integer.valueOf(i);
      localLoggerExt2.logInfo(str2, "Can not send request because its too early. Wait for {0} milliseconds before sending again...", arrayOfObject2);
      this.mInnerWrapper.requestThrottled(i);
      return true;
    }
    LoggerExt localLoggerExt1 = sLog;
    String str1 = this.mBurstlyViewId;
    Object[] arrayOfObject1 = new Object[3];
    arrayOfObject1[0] = UriConstants.getInstance().getPrimaryHost();
    arrayOfObject1[1] = this.mRequestData.getPublisher();
    arrayOfObject1[2] = this.mRequestData.getZone();
    localLoggerExt1.logInfo(str1, "Sending new request to {0} with publisher id :''{1}'' and zone id : ''{2}''...", arrayOfObject1);
    return false;
  }

  private static void isValidConfiguration(BurstlyView paramBurstlyView)
    throws InvalidBurstlyViewStateException
  {
    RequestData localRequestData = paramBurstlyView.mRequestData;
    String str1 = localRequestData.getPublisher();
    String str2 = localRequestData.getZone();
    boolean bool = Utils.isValidRequestParam(str1);
    String str3 = null;
    if (!bool)
    {
      sLog.logError(paramBurstlyView.mBurstlyViewId, "Can not make request to server! Publisher id ''{0}''is not a valid publisher id. Set another!", new Object[] { str1 });
      str3 = "Invalid publisher id: '" + str1 + "'";
    }
    if (!Utils.isValidRequestParam(str2))
    {
      sLog.logError(paramBurstlyView.mBurstlyViewId, "Can not make request to server! Zone id ''{0}''is not a valid zone id. Set another!", new Object[] { str2 });
      str3 = "Invalid zone id: '" + str2 + "'";
    }
    if (str3 != null)
      throw new InvalidBurstlyViewStateException(paramBurstlyView, str3);
  }

  private void mergePubTargetingToClientTargetingParams(Map<String, String> paramMap, RequestData paramRequestData)
  {
    Utils.mergeStringStringMaps(paramMap, Utils.parseParams(paramRequestData.getPubTargeting()));
  }

  @Deprecated
  public static void preinitializeNetwork(String paramString, Map<String, ?> paramMap)
  {
    try
    {
      PreinitializeManager.preinitializeAdaptor(paramString, paramMap);
      return;
    }
    finally
    {
      localObject = finally;
      throw localObject;
    }
  }

  private void prepareRequest()
  {
    String str = Utils.generateUID();
    RequestData.Request localRequest = this.mRequestData.getData();
    localRequest.setId(str);
    localRequest.setRvCR(Utils.getFailedIds(this.mFailedToShowComponents));
    RequestManager.ConnectionInfo localConnectionInfo = RequestManager.getConnectionInfo();
    localRequest.setCct(Integer.valueOf(localConnectionInfo.getCode()));
    localRequest.setCctDetailed(localConnectionInfo.getSubtipeName());
    localRequest.setSelectThisCreative((String[])this.mCustomCRIDParams.get("selectThisCreative"));
    ICurrencyManager localICurrencyManager = FeatureFactory.getCurrencyFeature();
    if (localICurrencyManager != null)
      localRequest.setAppUserId(localICurrencyManager.getUserId());
  }

  private void setCridParams(Map<String, ?> paramMap)
  {
    this.mCustomCRIDParams = paramMap;
  }

  void abortCurrentQueue()
  {
    if (this.mCurrentQueue != null)
    {
      this.mCurrentQueue.stopQueue();
      sLog.logInfo(this.mBurstlyViewId, "Queue execution stopped.", new Object[0]);
      this.mCurrentQueue = null;
    }
  }

  void abortCurrentRequest()
  {
    if (this.mCurrentRequest != null)
    {
      sLog.logInfo(this.mBurstlyViewId, "Cancelling previous request to burstly server...", new Object[0]);
      this.mCurrentRequest.abortRequest();
      this.mCurrentRequest = null;
    }
  }

  @Deprecated
  public void configure(Map<String, Object> paramMap)
  {
    String str1 = (String)paramMap.get("pub");
    sLog.logDebug(this.mBurstlyViewId, "Param 'pub' from server: {0}", new Object[] { str1 });
    if (str1 != null)
      this.mRequestData.setPublisher(str1);
    String str2 = (String)paramMap.get("zone");
    sLog.logDebug(this.mBurstlyViewId, "Param 'zone' from server: {0}", new Object[] { str2 });
    if (str2 != null)
      this.mRequestData.setZone(str2);
    String str3 = (String)paramMap.get("throttlingInterval");
    sLog.logDebug(this.mBurstlyViewId, "Param 'throttlingInterval' from server: {0}", new Object[] { str3 });
    if (str3 != null)
      sRequestThrottle = Utils.getIntValue(str3, Integer.valueOf(sRequestThrottle)).intValue();
    String str4 = (String)paramMap.get("logLevel");
    if (str4 != null)
      LoggerExt.setLogLevel(Integer.parseInt(str4));
  }

  @Deprecated
  public void destroy()
    throws WrongThreadException
  {
    Utils.checkIsUiThread();
    removeAllViews();
    if (!this.mIsDestroyed)
    {
      LoggerExt localLoggerExt2 = sLog;
      String str2 = this.mBurstlyViewId;
      Object[] arrayOfObject2 = new Object[1];
      arrayOfObject2[0] = this.mBurstlyViewId;
      localLoggerExt2.logInfo(str2, "Destroying burstly banner with {0} id...", arrayOfObject2);
      this.mIsDestroyed = true;
      AbortableAsyncTask.abortAllRequests(this.mBurstlyViewId);
      RequestManager.removeFromNetworkStateWatcher(this);
      abortCurrentRequest();
      abortCurrentQueue();
      removeCallback(this.mRefresher);
      removeCallback(this.mLoadTimeLimit);
      destroyController(this.mDisplayedBannerController);
      destroyController(this.mActiveController);
      LoggerExt localLoggerExt3 = sLog;
      String str3 = this.mBurstlyViewId;
      Object[] arrayOfObject3 = new Object[1];
      arrayOfObject3[0] = this.mBurstlyViewId;
      localLoggerExt3.logInfo(str3, "Destroyed burstly banner with {0} id...", arrayOfObject3);
      return;
    }
    LoggerExt localLoggerExt1 = sLog;
    String str1 = this.mBurstlyViewId;
    Object[] arrayOfObject1 = new Object[1];
    arrayOfObject1[0] = this.mBurstlyViewId;
    localLoggerExt1.logWarning(str1, "Can not destroy banner view {0} because it has been already destroyed.", arrayOfObject1);
  }

  public boolean equals(Object paramObject)
  {
    if (this == paramObject);
    BurstlyView localBurstlyView;
    do
    {
      do
      {
        return true;
        if (paramObject == null)
          return false;
        if (getClass() != paramObject.getClass())
          return false;
        localBurstlyView = (BurstlyView)paramObject;
        if (this.mBurstlyViewId != null)
          break;
      }
      while (localBurstlyView.mBurstlyViewId == null);
      return false;
    }
    while (this.mBurstlyViewId.equals(localBurstlyView.mBurstlyViewId));
    return false;
  }

  @Deprecated
  public IBurstlyAdListener getBurstlyAdListener()
  {
    return this.mClientListener;
  }

  @Deprecated
  public String getBurstlyViewId()
  {
    return this.mBurstlyViewId;
  }

  @Deprecated
  public Map<String, String> getClientTargetParams()
  {
    return this.mClientTargetParams;
  }

  @Deprecated
  public String getCrParms()
  {
    if (this.mIsDestroyed)
    {
      sLog.logWarning(this.mBurstlyViewId, "Can not get crParms from destroyed BurstlyView instance!", new Object[0]);
      return null;
    }
    return this.mRequestData.getCrParms();
  }

  @Deprecated
  public Map<String, ?> getCustomParamsForNetwork(String paramString)
  {
    return (Map)this.mCustomNetworkParams.get(paramString);
  }

  @Deprecated
  public int getDefaultSessionLife()
  {
    return this.mRefreshInterval / 1000;
  }

  @Deprecated
  public IAdaptorController getDisplayedBannerController()
  {
    return this.mDisplayedBannerController;
  }

  @Deprecated
  public IAdaptorController getDisplayedInterstitialController()
  {
    return this.mDisplayedInterstitialController;
  }

  @Deprecated
  public LastBurstlyError getLastError()
  {
    return this.mErrorAndState.getLastError();
  }

  @Deprecated
  public int getMinTimeUntilNextRequest()
  {
    long l1 = SystemClock.elapsedRealtime();
    long l2 = sRequestThrottle - (l1 - this.mLastSentTime);
    if (l2 > 0L)
      return (int)l2;
    return 0;
  }

  @Deprecated
  public String getPubTargetingParams()
  {
    if (this.mIsDestroyed)
    {
      sLog.logWarning(this.mBurstlyViewId, "Can not get publisher targeting from destroyed BurstlyView instance!", new Object[0]);
      return null;
    }
    return this.mRequestData.getPubTargeting();
  }

  @Deprecated
  public String getPublisherId()
  {
    if (this.mIsDestroyed)
    {
      sLog.logWarning(this.mBurstlyViewId, "Can not get publisher id from destroyed BurstlyView instance!", new Object[0]);
      return null;
    }
    return this.mRequestData.getPublisher();
  }

  RequestData getRequestData()
  {
    return this.mRequestData.clone();
  }

  @Deprecated
  public BurstlyViewState getState()
  {
    return this.mErrorAndState.getViewState();
  }

  @Deprecated
  public String getZoneId()
  {
    if (this.mIsDestroyed)
    {
      sLog.logWarning(this.mBurstlyViewId, "Can not get zone id from destroyed BurstlyView instance!", new Object[0]);
      return null;
    }
    return this.mRequestData.getZone();
  }

  public int hashCode()
  {
    if (this.mBurstlyViewId == null);
    for (int i = 0; ; i = this.mBurstlyViewId.hashCode())
      return i + 31;
  }

  @Deprecated
  public boolean isAutorefreshMode()
  {
    return this.mRefreshInterval != 0;
  }

  @Deprecated
  public Boolean isCachedAdExpired()
  {
    if ((this.mPrecacheRequestSuccessfullyFinished) && (this.mActiveController != null))
      return Boolean.valueOf(Utils.isAdExpired(this.mActiveController.getCurrentAdData()));
    return null;
  }

  public boolean isConstantRecepient()
  {
    return false;
  }

  public final boolean isDestroyed()
  {
    return this.mIsDestroyed;
  }

  @Deprecated
  public boolean isPaused()
  {
    return this.mIsPaused;
  }

  final boolean isPrecacheRequest()
  {
    return this.mPrecacheRequest;
  }

  void notifyAboutToRequest()
  {
    this.mInnerWrapper.startRequestToServer();
  }

  @Deprecated
  public void onHideActivity()
    throws WrongThreadException
  {
    Utils.checkIsUiThread();
    if (!this.mIsDestroyed)
    {
      if (!this.mIsHidden)
      {
        this.mIsHidden = true;
        LoggerExt localLoggerExt = sLog;
        String str = this.mBurstlyViewId;
        Object[] arrayOfObject = new Object[1];
        arrayOfObject[0] = this.mBurstlyViewId;
        localLoggerExt.logDebug(str, "Hiding {0} banner... Stopping autorefresh thread...", arrayOfObject);
        abortCurrentRequest();
        abortCurrentQueue();
        AbortableAsyncTask.abortAllRequests(this.mBurstlyViewId);
        removeCallback(this.mRefresher);
        if (this.mDisplayedBannerController != null)
          this.mDisplayedBannerController.pause();
        return;
      }
      if ((this.mFullscreenInfo != null) && (!this.mFullscreenInfo.isActivityBased()) && (this.mDisplayedInterstitialController != null))
        this.mDisplayedInterstitialController.pause();
      sLog.logDebug(this.mBurstlyViewId, "skipping onHideActivity on hidden BurstlyView banner.", new Object[0]);
      return;
    }
    sLog.logWarning(this.mBurstlyViewId, "Can not execute onHideActivity on destroyed or hidden BurstlyView banner.", new Object[0]);
  }

  public boolean onInterceptTouchEvent(MotionEvent paramMotionEvent)
  {
    try
    {
      boolean bool = super.onInterceptTouchEvent(paramMotionEvent);
      return bool;
    }
    catch (Exception localException)
    {
      sLog.logWarning(TAG, Log.getStackTraceString(localException), new Object[0]);
    }
    return true;
  }

  public boolean onKeyDown(int paramInt, KeyEvent paramKeyEvent)
  {
    try
    {
      boolean bool = super.onKeyDown(paramInt, paramKeyEvent);
      return bool;
    }
    catch (Exception localException)
    {
      sLog.logWarning(TAG, Log.getStackTraceString(localException), new Object[0]);
    }
    return true;
  }

  public boolean onKeyMultiple(int paramInt1, int paramInt2, KeyEvent paramKeyEvent)
  {
    try
    {
      boolean bool = super.onKeyMultiple(paramInt1, paramInt2, paramKeyEvent);
      return bool;
    }
    catch (Exception localException)
    {
      sLog.logWarning(TAG, Log.getStackTraceString(localException), new Object[0]);
    }
    return true;
  }

  public boolean onKeyPreIme(int paramInt, KeyEvent paramKeyEvent)
  {
    try
    {
      boolean bool = super.onKeyPreIme(paramInt, paramKeyEvent);
      return bool;
    }
    catch (Exception localException)
    {
      sLog.logWarning(TAG, Log.getStackTraceString(localException), new Object[0]);
    }
    return true;
  }

  public boolean onKeyShortcut(int paramInt, KeyEvent paramKeyEvent)
  {
    try
    {
      boolean bool = super.onKeyShortcut(paramInt, paramKeyEvent);
      return bool;
    }
    catch (Exception localException)
    {
      sLog.logWarning(TAG, Log.getStackTraceString(localException), new Object[0]);
    }
    return true;
  }

  public boolean onKeyUp(int paramInt, KeyEvent paramKeyEvent)
  {
    try
    {
      boolean bool = super.onKeyUp(paramInt, paramKeyEvent);
      return bool;
    }
    catch (Exception localException)
    {
      sLog.logWarning(TAG, Log.getStackTraceString(localException), new Object[0]);
    }
    return true;
  }

  protected void onLayout(boolean paramBoolean, int paramInt1, int paramInt2, int paramInt3, int paramInt4)
  {
    try
    {
      super.onLayout(paramBoolean, paramInt1, paramInt2, paramInt3, paramInt4);
      return;
    }
    catch (Exception localException)
    {
      sLog.logThrowable(TAG, localException);
    }
  }

  @Deprecated
  public void onShowActivity()
    throws WrongThreadException
  {
    Utils.checkIsUiThread();
    if (!this.mIsDestroyed)
    {
      if ((this.mFullscreenInfo != null) && (!this.mFullscreenInfo.isActivityBased()))
        if (this.mDisplayedInterstitialController != null)
          this.mDisplayedInterstitialController.resume();
      do
      {
        return;
        if (!this.mIsHidden)
          break;
        this.mIsHidden = false;
        LoggerExt localLoggerExt = sLog;
        String str = this.mBurstlyViewId;
        Object[] arrayOfObject = new Object[1];
        arrayOfObject[0] = this.mBurstlyViewId;
        localLoggerExt.logDebug(str, "{0} coming foreground...", arrayOfObject);
        setPaused(this.mIsPaused);
        if (this.mFullscreenInfo != null)
          this.mInnerWrapper.onHideFullscreen(this.mFullscreenInfo);
      }
      while (this.mDisplayedBannerController == null);
      this.mDisplayedBannerController.resume();
      return;
      sLog.logDebug(this.mBurstlyViewId, "skipping onShowActivity on shown BurstlyView banner.", new Object[0]);
      return;
    }
    sLog.logWarning(this.mBurstlyViewId, "Can not execute onShowActivity on destroyed BurstlyView banner.", new Object[0]);
  }

  protected void onSizeChanged(int paramInt1, int paramInt2, int paramInt3, int paramInt4)
  {
    super.onSizeChanged(paramInt1, paramInt2, paramInt3, paramInt4);
    this.mInnerWrapper.viewDidChangeSize(new AdSize(paramInt2, paramInt1), new AdSize(paramInt4, paramInt3));
  }

  public boolean onTouchEvent(MotionEvent paramMotionEvent)
  {
    try
    {
      boolean bool = super.onTouchEvent(paramMotionEvent);
      return bool;
    }
    catch (Exception localException)
    {
      sLog.logWarning(TAG, Log.getStackTraceString(localException), new Object[0]);
    }
    return true;
  }

  public boolean onTrackballEvent(MotionEvent paramMotionEvent)
  {
    try
    {
      boolean bool = super.onTrackballEvent(paramMotionEvent);
      return bool;
    }
    catch (Exception localException)
    {
      sLog.logWarning(TAG, Log.getStackTraceString(localException), new Object[0]);
    }
    return true;
  }

  public void onWindowFocusChanged(boolean paramBoolean)
  {
    LoggerExt localLoggerExt = sLog;
    String str = this.mBurstlyViewId;
    Object[] arrayOfObject = new Object[1];
    arrayOfObject[0] = Boolean.valueOf(paramBoolean);
    localLoggerExt.logDebug(str, "Has focus : {0}", arrayOfObject);
    super.onWindowFocusChanged(paramBoolean);
  }

  @Deprecated
  public void precacheAd()
  {
    sLog.logDebug(this.mBurstlyViewId, "Starting precache request...", new Object[0]);
    this.mPrecacheRequest = true;
    sendRequestForAd();
  }

  void removeCallback(Runnable paramRunnable)
  {
    this.mMainHandler.removeCallbacks(paramRunnable);
  }

  @Deprecated
  public void resetDefaultSessionLife()
  {
    this.mRefreshInterval = 0;
  }

  void resetServerSideInterval()
  {
    this.mServerSideRefreshInterval = 0;
  }

  void restartRequest(boolean paramBoolean)
  {
    this.mPrecacheRequest = paramBoolean;
    sLog.logInfo(this.mBurstlyViewId, "Restarting request to server with previous data, because of previous response could not be handled.", new Object[0]);
    startRequest();
  }

  void scheduleRefresh(int paramInt)
  {
    LoggerExt localLoggerExt = sLog;
    String str = this.mBurstlyViewId;
    Object[] arrayOfObject = new Object[1];
    arrayOfObject[0] = Integer.valueOf(paramInt);
    localLoggerExt.logInfo(str, "Scheduling refresh... Rerequest in {0} millis.", arrayOfObject);
    removeCallback(this.mRefresher);
    this.mMainHandler.postDelayed(this.mRefresher, paramInt);
  }

  @Deprecated
  public void sendRequestForAd()
    throws InvalidBurstlyViewStateException, WrongThreadException
  {
    Utils.checkIsUiThread();
    if (!this.mIsDestroyed)
    {
      if (!this.mPrecacheRequest)
        this.mIsPaused = false;
      checkParamsValidity();
      if ((this.mPrecacheRequestSuccessfullyFinished) && (!this.mPrecacheRequest))
      {
        notifyAboutToRequest();
        this.mPrecacheRequestSuccessfullyFinished = false;
        this.mActiveController.setPrefetchedRequest(false);
        this.mActiveController.showPrecachedAd();
      }
      while (isTooEarly())
        return;
      isValidConfiguration(this);
      notifyAboutToRequest();
      removeCallback(this.mRefresher);
      if ((this.mPrecacheRequestSuccessfullyFinished) && (this.mPrecacheRequest))
        this.mActiveController.getAdaptor().endTransaction(IBurstlyAdaptor.TransactionCode.CODE_CANCELLED);
      startRequest();
      return;
    }
    sLog.logWarning(this.mBurstlyViewId, "Can not make request for new Ad because this old Burstly View instance has been destroyed by calling destroy() method. Skip call.", new Object[0]);
  }

  @Deprecated
  public void sendRequestForAd(final int paramInt)
    throws InvalidBurstlyViewStateException
  {
    if (!this.mIsDestroyed)
    {
      checkParamsValidity();
      removeCallback(this.mLoadTimeLimit);
      this.mLoadTimeLimit = null;
      if (paramInt > 0)
      {
        this.mLoadTimeLimit = new Runnable()
        {
          public void run()
          {
            LoggerExt localLoggerExt = BurstlyView.sLog;
            String str = BurstlyView.this.mBurstlyViewId;
            Object[] arrayOfObject = new Object[1];
            arrayOfObject[0] = Integer.valueOf(paramInt);
            localLoggerExt.logWarning(str, "Finishing request due load timeout {0}.", arrayOfObject);
            BurstlyView.this.abortCurrentRequest();
            BurstlyView.this.abortCurrentQueue();
            BurstlyView.this.setLastError(LastBurstlyError.REQUEST_TIMED_OUT);
            BurstlyView.this.mInnerWrapper.failedToDisplayAds();
          }
        };
        this.mMainHandler.postDelayed(this.mLoadTimeLimit, paramInt);
      }
      sendRequestForAd();
      return;
    }
    sLog.logWarning(this.mBurstlyViewId, "Can not make request for new Ad because this old Burstly View banner instance has been destroyed by calling destroy() method. Skip call.", new Object[0]);
  }

  void setActiveController(IAdaptorController paramIAdaptorController)
  {
    this.mActiveController = paramIAdaptorController;
  }

  public void setAdSize(BurstlyAdSize paramBurstlyAdSize)
  {
    if (paramBurstlyAdSize != null)
      this.mRequestData.getData().setAdSize(paramBurstlyAdSize.toString());
  }

  @Deprecated
  public void setBurstlyAdListener(IBurstlyAdListener paramIBurstlyAdListener)
  {
    this.mClientListener = paramIBurstlyAdListener;
  }

  @Deprecated
  public void setBurstlyViewId(String paramString)
    throws InvalidBurstlyViewStateException
  {
    if (paramString == null)
    {
      sLog.logError("BurstlySDK", "Can not set null burstly view id!", new Object[0]);
      return;
    }
    this.mBurstlyViewId = paramString;
  }

  public void setBurstlyViewState(BurstlyViewState paramBurstlyViewState)
  {
    this.mErrorAndState.setBurstlyViewState(paramBurstlyViewState);
  }

  @Deprecated
  public void setClientTargetParams(Map<String, String> paramMap)
  {
    this.mClientTargetParams = paramMap;
  }

  @Deprecated
  public void setCrParms(String paramString)
  {
    if (paramString == null)
    {
      sLog.logError(this.mBurstlyViewId, "Can not set null as crParms!", new Object[0]);
      return;
    }
    this.mRequestData.setCrParms(paramString);
  }

  @Deprecated
  public void setCustomParamsForNetwork(String paramString, Map<String, ?> paramMap)
  {
    if ((paramString != null) && (!paramString.equals("")) && (paramMap != null))
      this.mCustomNetworkParams.put(paramString, paramMap);
  }

  @Deprecated
  public void setDefaultSessionLife(int paramInt)
  {
    int i = paramInt * 1000;
    if (i >= sRequestThrottle)
    {
      this.mRefreshInterval = i;
      return;
    }
    this.mRefreshInterval = sRequestThrottle;
    LoggerExt localLoggerExt = sLog;
    String str = this.mBurstlyViewId;
    Object[] arrayOfObject = new Object[1];
    arrayOfObject[0] = Integer.valueOf(sRequestThrottle);
    localLoggerExt.logWarning(str, "Interval can not be less than {0} millis! It was set to {0} millis.", arrayOfObject);
  }

  @Deprecated
  public void setDisplayedBannerController(IAdaptorController paramIAdaptorController)
  {
    if (this.mDisplayedBannerController != null)
      this.mDisplayedBannerController.stop();
    this.mDisplayedBannerController = paramIAdaptorController;
  }

  @Deprecated
  public void setDisplayedInterstitialController(IAdaptorController paramIAdaptorController)
  {
    if (this.mDisplayedInterstitialController != null)
      this.mDisplayedInterstitialController.stop();
    this.mDisplayedInterstitialController = paramIAdaptorController;
  }

  public void setInterstitalMode(boolean paramBoolean)
  {
    this.mIsInterstitial = Boolean.valueOf(paramBoolean);
  }

  public void setLastError(LastBurstlyError paramLastBurstlyError)
  {
    this.mErrorAndState.setLastError(paramLastBurstlyError);
  }

  @Deprecated
  public void setMaxAdSize(int paramInt1, int paramInt2)
  {
    LoggerExt localLoggerExt1 = sLog;
    String str1 = this.mBurstlyViewId;
    Object[] arrayOfObject1 = new Object[2];
    arrayOfObject1[0] = Integer.valueOf(paramInt1);
    arrayOfObject1[1] = Integer.valueOf(paramInt2);
    localLoggerExt1.logDebug(str1, "Setting max ad size to: {0}x{1}", arrayOfObject1);
    if ((paramInt1 > 0) || (paramInt2 > 0))
    {
      ((int)Utils.scale(paramInt1));
      ((int)Utils.scale(paramInt2));
      return;
    }
    LoggerExt localLoggerExt2 = sLog;
    String str2 = this.mBurstlyViewId;
    Object[] arrayOfObject2 = new Object[2];
    arrayOfObject2[0] = Integer.valueOf(paramInt1);
    arrayOfObject2[1] = Integer.valueOf(paramInt2);
    localLoggerExt2.logError(str2, "Invalid max ad size provided: width = {0}, height = {1}!", arrayOfObject2);
  }

  @Deprecated
  public void setPaused(boolean paramBoolean)
    throws WrongThreadException
  {
    Utils.checkIsUiThread();
    if (!this.mIsDestroyed)
    {
      this.mIsPaused = paramBoolean;
      if (paramBoolean)
      {
        LoggerExt localLoggerExt2 = sLog;
        String str2 = this.mBurstlyViewId;
        Object[] arrayOfObject2 = new Object[1];
        arrayOfObject2[0] = this.mBurstlyViewId;
        localLoggerExt2.logDebug(str2, "Burstly view {0} has been paused.", arrayOfObject2);
        abortCurrentRequest();
        removeCallback(this.mRefresher);
        return;
      }
      LoggerExt localLoggerExt1 = sLog;
      String str1 = this.mBurstlyViewId;
      Object[] arrayOfObject1 = new Object[1];
      arrayOfObject1[0] = this.mBurstlyViewId;
      localLoggerExt1.logDebug(str1, "Burstly view {0} has been resumed.", arrayOfObject1);
      startDelayedRequest();
      return;
    }
    sLog.logWarning(this.mBurstlyViewId, "Can not pause/unpause destroyed BurstlyView instance!", new Object[0]);
  }

  final void setPrecacheRequest(boolean paramBoolean)
  {
    this.mPrecacheRequest = paramBoolean;
  }

  @Deprecated
  public void setPubTargetingParams(String paramString)
  {
    if (paramString == null)
    {
      sLog.logError(this.mBurstlyViewId, "Can not set null as custom targeting parameters!", new Object[0]);
      return;
    }
    this.mRequestData.setPubTargeting(paramString);
  }

  @Deprecated
  public void setPublisherId(String paramString)
  {
    if (paramString == null)
      sLog.logError(this.mBurstlyViewId, "Can not set null publisher id!", new Object[0]);
    while (paramString.equals(this.mRequestData.getPublisher()))
      return;
    this.mRequestData.setPublisher(paramString);
    ServerConfigurationService.initService(getContext(), paramString);
    ServerConfigurationService.addRecipient(this);
  }

  void setServerSideRefreshInterval(int paramInt)
  {
    this.mServerSideRefreshInterval = paramInt;
  }

  @Deprecated
  public void setUseCachedResponse(boolean paramBoolean)
  {
    ResponseSaver localResponseSaver = this.mRequestManager.getResponseSaver();
    localResponseSaver.setAllowedToLoad(paramBoolean);
    localResponseSaver.setAllowedToSave(paramBoolean);
  }

  @Deprecated
  public void setZoneId(String paramString)
  {
    if (paramString == null)
    {
      sLog.logError(this.mBurstlyViewId, "Can not set null zone id!", new Object[0]);
      return;
    }
    this.mRequestData.setZone(paramString);
    RequestManager localRequestManager = new RequestManager(getContext(), paramString);
    localRequestManager.getResponseSaver().setAllowedToSave(this.mRequestManager.getResponseSaver().isAllowedToSave());
    localRequestManager.getResponseSaver().setAllowedToLoad(this.mRequestManager.getResponseSaver().isAllowedToLoad());
    this.mRequestManager = localRequestManager;
  }

  @Deprecated
  public void startDelayedRequest()
    throws WrongThreadException
  {
    Utils.checkIsUiThread();
    if ((!this.mIsPaused) && (!this.mIsHidden) && (!this.mIsDestroyed))
      if (!this.mIsDestroyed)
        if (this.mServerSideRefreshInterval > 0)
        {
          i = this.mServerSideRefreshInterval;
          this.mRefresher.setServerSideSessionLength(this.mServerSideRefreshInterval);
          if (i > 0)
          {
            scheduleRefresh(i);
            resetServerSideInterval();
          }
        }
    while (this.mRefreshInterval <= 0)
    {
      while (true)
      {
        return;
        int i = this.mRefreshInterval;
      }
      sLog.logInfo(this.mBurstlyViewId, "Old burslty view has been destroyed. Skip delayed request for it.", new Object[0]);
      return;
    }
    sLog.logInfo(this.mBurstlyViewId, "Can not continue. Burstly is paused or hidden or destroyed.", new Object[0]);
  }

  void startMainQueue(Collection<ComponentQueueElement> paramCollection, RequestData paramRequestData, Map<String, String> paramMap, boolean paramBoolean)
  {
    this.mCurrentRequest = null;
    if (!this.mIsDestroyed)
      if (!paramCollection.isEmpty())
      {
        this.mCurrentQueue = new ComponentQueue(paramCollection, paramRequestData, this.mSelf, this.mRequestManager.getResponseSaver());
        this.mCurrentQueue.setBurstlyAdListener(this.mInnerWrapper);
        this.mCurrentQueue.setFaildToShowCollector(this.mFailedToShowComponents);
        this.mCurrentQueue.setComponentChangeListener(createQueueListener());
        mergePubTargetingToClientTargetingParams(paramMap, paramRequestData);
        this.mCurrentQueue.setExplicitParams(paramMap);
        this.mCurrentQueue.setCustomNetworkParams(this.mCustomNetworkParams);
        if (this.mIsInterstitial != null)
          this.mCurrentQueue.setInterstitialMode(this.mIsInterstitial.booleanValue());
        this.mCurrentQueue.execute();
      }
    while (true)
    {
      this.mPrecacheRequest = false;
      return;
      if (paramBoolean)
      {
        this.mFailedToShowComponents.clear();
        this.mInnerWrapper.failedToDisplayAds();
        continue;
        sLog.logInfo(this.mBurstlyViewId, "No sense in parsing server response because old banner has been destroyed.", new Object[0]);
      }
    }
  }

  void startRequest()
  {
    prepareRequest();
    this.mLastSentTime = SystemClock.elapsedRealtime();
    abortCurrentRequest();
    abortCurrentQueue();
    this.mCurrentRequest = this.mRequestManager.makeAdRequest(new RequestManager.RequestDataObject(UriConstants.SINGLE_AD_URI, this.mRequestData.clone(), this.mBurstlyViewId, new AdRequestCallback(this), ResponseBean.class));
  }

  public String toString()
  {
    return getBurstlyViewId();
  }

  private class BursltyListenerWrapper
    implements IInternalBurstlyAdListener
  {
    private static final String INNER_LISTENER = " INNER LISTENER";

    private BursltyListenerWrapper()
    {
    }

    private void postToUi(SafeInvoker paramSafeInvoker)
    {
      if (!BurstlyView.this.mIsDestroyed)
      {
        BurstlyView.this.mMainHandler.post(paramSafeInvoker);
        return;
      }
      BurstlyView.sLog.logDebug(BurstlyView.this.mBurstlyViewId, "callback ignored as BurstlyView was destroyed", new Object[0]);
    }

    public void adNetworkDismissFullScreen(final String paramString)
    {
      BurstlyView.this.setBurstlyViewState(BurstlyViewState.IDLE);
      BurstlyView.this.setLastError(LastBurstlyError.OK);
      BurstlyView.sLog.logDebug(BurstlyView.this.mBurstlyViewId + " INNER LISTENER", "adNetworkDismissFullScreen({0})", new Object[] { paramString });
      postToUi(new SafeInvoker(BurstlyView.this.mClientListener, BurstlyView.this.mBurstlyViewId)
      {
        void invoke()
        {
          BurstlyView.this.mClientListener.adNetworkDismissFullScreen(paramString);
        }

        public void run()
        {
          BurstlyView.this.onShowActivity();
          super.run();
        }
      });
    }

    public void adNetworkPresentFullScreen(final String paramString)
    {
      BurstlyView.this.setBurstlyViewState(BurstlyViewState.SHOWING);
      BurstlyView.this.setLastError(LastBurstlyError.OK);
      BurstlyView.sLog.logDebug(BurstlyView.this.mBurstlyViewId + " INNER LISTENER", "adNetworkPresentFullScreen({0})", new Object[] { paramString });
      postToUi(new SafeInvoker(BurstlyView.this.mClientListener, BurstlyView.this.mBurstlyViewId)
      {
        void invoke()
        {
          BurstlyView.this.mClientListener.adNetworkPresentFullScreen(paramString);
        }

        public void run()
        {
          BurstlyView.this.onHideActivity();
          super.run();
        }
      });
    }

    public void adNetworkWasClicked(final String paramString)
    {
      BurstlyView.sLog.logDebug(BurstlyView.this.mBurstlyViewId + " INNER LISTENER", "adNetworkWasClicked({0})", new Object[] { paramString });
      postToUi(new SafeInvoker(BurstlyView.this.mClientListener, BurstlyView.this.mBurstlyViewId)
      {
        void invoke()
        {
          BurstlyView.this.mClientListener.adNetworkWasClicked(paramString);
        }
      });
    }

    public void attemptingToLoad(final String paramString)
    {
      BurstlyView.sLog.logDebug(BurstlyView.this.mBurstlyViewId + " INNER LISTENER", "attemptingToLoad({0})", new Object[] { paramString });
      UiExceptionHandlerManager.registerHandler(new UnhandledExceptionDumpWrapper(BurstlyView.this.mActiveController));
      postToUi(new SafeInvoker(BurstlyView.this.mClientListener, BurstlyView.this.mBurstlyViewId)
      {
        void invoke()
        {
          BurstlyView.this.mClientListener.attemptingToLoad(paramString);
        }
      });
    }

    public void didLoad(final String paramString, final boolean paramBoolean)
    {
      LoggerExt localLoggerExt = BurstlyView.sLog;
      String str = BurstlyView.this.mBurstlyViewId + " INNER LISTENER";
      Object[] arrayOfObject = new Object[2];
      arrayOfObject[0] = paramString;
      arrayOfObject[1] = Boolean.valueOf(paramBoolean);
      localLoggerExt.logDebug(str, "didLoad({0},{1})", arrayOfObject);
      BurstlyView.this.mCurrentQueue = null;
      BurstlyView.this.setBurstlyViewState(BurstlyViewState.SHOWING);
      BurstlyView.this.setLastError(LastBurstlyError.OK);
      BurstlyView.this.mFailedToShowComponents.clear();
      BurstlyView.this.startDelayedRequest();
      BurstlyView.this.removeCallback(BurstlyView.this.mLoadTimeLimit);
      postToUi(new SafeInvoker(BurstlyView.this.mClientListener, BurstlyView.this.mBurstlyViewId)
      {
        void invoke()
        {
          BurstlyView.this.mClientListener.didLoad(paramString, paramBoolean);
        }
      });
      finishRequestToServer();
    }

    public void didPrecacheAd(final String paramString)
    {
      BurstlyView.sLog.logDebug(BurstlyView.this.mBurstlyViewId + " INNER LISTENER", "didPrecacheAd({0})", new Object[] { paramString });
      BurstlyView.this.mCurrentQueue = null;
      BurstlyView.this.mPrecacheRequestSuccessfullyFinished = true;
      BurstlyView.this.setLastError(LastBurstlyError.OK);
      BurstlyView.this.setBurstlyViewState(BurstlyViewState.PRECACHED);
      postToUi(new SafeInvoker(BurstlyView.this.mClientListener, BurstlyView.this.mBurstlyViewId)
      {
        void invoke()
        {
          BurstlyView.this.mClientListener.didPrecacheAd(paramString);
        }
      });
      finishRequestToServer();
    }

    public void failedToDisplayAds()
    {
      BurstlyView.sLog.logDebug(BurstlyView.this.mBurstlyViewId + " INNER LISTENER", "failedToDisplayAds()", new Object[0]);
      BurstlyView.this.setBurstlyViewState(BurstlyViewState.IDLE);
      BurstlyView.this.setLastError(LastBurstlyError.NO_FILL);
      BurstlyView.this.removeCallback(BurstlyView.this.mLoadTimeLimit);
      BurstlyView.this.startDelayedRequest();
      postToUi(new SafeInvoker(BurstlyView.this.mClientListener, BurstlyView.this.mBurstlyViewId)
      {
        void invoke()
        {
          BurstlyView.this.mClientListener.failedToDisplayAds();
        }
      });
      finishRequestToServer();
    }

    public void failedToLoad(final String paramString)
    {
      BurstlyView.sLog.logDebug(BurstlyView.this.mBurstlyViewId + " INNER LISTENER", "failedToLoad({0})", new Object[] { paramString });
      postToUi(new SafeInvoker(BurstlyView.this.mClientListener, BurstlyView.this.mBurstlyViewId)
      {
        void invoke()
        {
          BurstlyView.this.mClientListener.failedToLoad(paramString);
        }
      });
    }

    public void finishRequestToServer()
    {
      if (!BurstlyView.this.mSelf.isShown())
        BurstlyView.sLog.logWarning(BurstlyView.this.mBurstlyViewId + " INNER LISTENER", "Burstly view isn't visible, therefore no ads will be visible until you attach the view to a view root or set visibility to VISIBLE.", new Object[0]);
      BurstlyView.sLog.logDebug(BurstlyView.this.mBurstlyViewId + " INNER LISTENER", "finishRequestToServer()", new Object[0]);
      postToUi(new SafeInvoker(BurstlyView.this.mClientListener, BurstlyView.this.mBurstlyViewId)
      {
        void invoke()
        {
          BurstlyView.this.mClientListener.finishRequestToServer();
        }
      });
      UiExceptionHandlerManager.cleanUp();
    }

    public void onCollapse()
    {
      BurstlyView.sLog.logDebug(BurstlyView.this.mBurstlyViewId, "onCollapse()", new Object[0]);
      postToUi(new SafeInvoker(BurstlyView.this.mClientListener, BurstlyView.this.mBurstlyViewId)
      {
        void invoke()
        {
          BurstlyView.this.mClientListener.onCollapse();
        }
      });
      onHideFullscreen(BurstlyView.this.mFullscreenInfo);
    }

    public void onExpand(final boolean paramBoolean)
    {
      LoggerExt localLoggerExt = BurstlyView.sLog;
      String str1 = BurstlyView.this.mBurstlyViewId;
      Object[] arrayOfObject = new Object[1];
      arrayOfObject[0] = Boolean.valueOf(paramBoolean);
      localLoggerExt.logDebug(str1, "onExpand({0})", arrayOfObject);
      postToUi(new SafeInvoker(BurstlyView.this.mClientListener, BurstlyView.this.mBurstlyViewId)
      {
        void invoke()
        {
          BurstlyView.this.mClientListener.onExpand(paramBoolean);
        }
      });
      if (BurstlyView.this.mActiveController != null);
      for (String str2 = BurstlyView.this.mActiveController.getNetworkName(); ; str2 = "Unknown network")
      {
        onShowFullscreen(new IBurstlyAdaptorListener.FullscreenInfo(str2, false));
        return;
      }
    }

    public void onHide()
    {
      BurstlyView.sLog.logDebug(BurstlyView.this.mBurstlyViewId, "onHide()", new Object[0]);
      postToUi(new SafeInvoker(BurstlyView.this.mClientListener, BurstlyView.this.mBurstlyViewId)
      {
        void invoke()
        {
          BurstlyView.this.mClientListener.onHide();
        }
      });
    }

    public void onHideFullscreen(IBurstlyAdaptorListener.FullscreenInfo paramFullscreenInfo)
    {
      if (BurstlyView.this.mFullscreenInfo != null)
      {
        BurstlyView.this.mFullscreenInfo = null;
        BurstlyView.access$302(BurstlyView.this, null);
        adNetworkDismissFullScreen(paramFullscreenInfo.getNetworkName());
      }
    }

    public void onShow()
    {
      BurstlyView.sLog.logDebug(BurstlyView.this.mBurstlyViewId, "onShow()", new Object[0]);
      postToUi(new SafeInvoker(BurstlyView.this.mClientListener, BurstlyView.this.mBurstlyViewId)
      {
        void invoke()
        {
          BurstlyView.this.mClientListener.onShow();
        }
      });
    }

    public void onShowFullscreen(IBurstlyAdaptorListener.FullscreenInfo paramFullscreenInfo)
    {
      if (BurstlyView.this.mFullscreenInfo == null)
        adNetworkPresentFullScreen(paramFullscreenInfo.getNetworkName());
      BurstlyView.this.mFullscreenInfo = paramFullscreenInfo;
    }

    public void requestThrottled(final int paramInt)
    {
      LoggerExt localLoggerExt = BurstlyView.sLog;
      String str = BurstlyView.this.mBurstlyViewId + " INNER LISTENER";
      Object[] arrayOfObject = new Object[1];
      arrayOfObject[0] = Integer.valueOf(paramInt);
      localLoggerExt.logDebug(str, "requestThrottled({0})", arrayOfObject);
      if (BurstlyView.this.mErrorAndState.getViewState() != BurstlyViewState.PRECACHED)
        BurstlyView.this.setBurstlyViewState(BurstlyViewState.IDLE);
      BurstlyView.this.setLastError(LastBurstlyError.THROTTLE);
      postToUi(new SafeInvoker(BurstlyView.this.mClientListener, BurstlyView.this.mBurstlyViewId)
      {
        void invoke()
        {
          BurstlyView.this.mClientListener.requestThrottled(paramInt);
        }
      });
    }

    public void startRequestToServer()
    {
      BurstlyView.sLog.logDebug(BurstlyView.this.mBurstlyViewId + " INNER LISTENER", "startRequestToServer()", new Object[0]);
      BurstlyView localBurstlyView = BurstlyView.this;
      if (BurstlyView.this.mPrecacheRequest);
      for (BurstlyViewState localBurstlyViewState = BurstlyViewState.PRECACHING; ; localBurstlyViewState = BurstlyViewState.RETRIEVING)
      {
        localBurstlyView.setBurstlyViewState(localBurstlyViewState);
        postToUi(new SafeInvoker(BurstlyView.this.mClientListener, BurstlyView.this.mBurstlyViewId)
        {
          void invoke()
          {
            BurstlyView.this.mClientListener.startRequestToServer();
          }
        });
        return;
      }
    }

    public void viewDidChangeSize(final AdSize paramAdSize1, final AdSize paramAdSize2)
    {
      LoggerExt localLoggerExt = BurstlyView.sLog;
      String str = BurstlyView.this.mBurstlyViewId;
      Object[] arrayOfObject = new Object[4];
      arrayOfObject[0] = Integer.valueOf(paramAdSize1.getWidth());
      arrayOfObject[1] = Integer.valueOf(paramAdSize1.getHeight());
      arrayOfObject[2] = Integer.valueOf(paramAdSize2.getWidth());
      arrayOfObject[3] = Integer.valueOf(paramAdSize2.getHeight());
      localLoggerExt.logDebug(str, "viewDidChangeSize(new - w:{0}, h: {1}, old - w:{2}, h: {3})", arrayOfObject);
      postToUi(new SafeInvoker(BurstlyView.this.mClientListener, BurstlyView.this.mBurstlyViewId)
      {
        void invoke()
        {
          BurstlyView.this.mClientListener.viewDidChangeSize(paramAdSize1, paramAdSize2);
        }
      });
    }
  }
}

/* Location:           E:\android\Toy Defense 2_dex2jar.jar
 * Qualified Name:     com.burstly.lib.ui.BurstlyView
 * JD-Core Version:    0.6.2
 */